package com.haidechizi.fastadmin.modules.oss.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.haidechizi.fastadmin.common.page.PageDto;
import com.haidechizi.fastadmin.common.utils.PageInfo;
import com.haidechizi.fastadmin.modules.oss.dao.SysOssDao;
import com.haidechizi.fastadmin.modules.oss.entity.SysOss;
import com.haidechizi.fastadmin.modules.oss.service.SysOssService;
import org.springframework.stereotype.Service;


@Service
public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOss> implements SysOssService {

    @Override
    public PageInfo queryPage(PageDto pageDto, SysOss sysOss) {
        Wrapper<SysOss> wrapper = new EntityWrapper<>();
        Page<SysOss> page = this.selectPage(
                pageDto.cover2Page()
        );
        int count = super.selectCount(wrapper);
        page.setTotal(count);
        return new PageInfo(page);
    }

}
